-
Notifications
You must be signed in to change notification settings - Fork 0
feat: connect the filters and the sort on the Elements page #135
Merged
+1,987
−121
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… list of outcomes
…o the default sort
…sabled filter on touch
xeniag
reviewed
Oct 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, one quick change before merge:
if loading the filter structure fails, the page can discard the URL filters and show unfiltered results. It should show an error and skip the search instead (ElementsPage.tsx).
This was referenced Oct 30, 2026
xeniag
approved these changes
Oct 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Sign in
to join this conversation on GitHub.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Connects the filters (#127) and the sort (#128) on the Elements page, in one pull request. It replaces #134 (the sort), which is closed: this branch contains the sort from #134 and the filters from #127. The two issues stay separate. Part of #110.
The filters (#127)
number(a vault group is shown as "Group N", like in the list). Choosing another apparatus clears the group.Apparatus.difficultyValues), so only bands that have a vault are offered and the API needs no ranges. The chosen difficulty is dropped when the apparatus changes between vault and the others, because the scales differ.aria-disabledand not thedisabledattribute, so the keyboard can still reach it; the reason is a tooltip (hover, focus, and also on a tap, because a tooltip does not open on touch) and thearia-describedbytext.?search=...&apparatus=UB&group=UB-2&difficulty=A,B, and for vault the bands?apparatus=VT&difficulty=2,3. A filter change is a new history step, so the back button undoes it. "Clear filters" appears when a filter is set, and moves the focus to the first filter because the button disappears.BAD_USER_INPUT. Each change is made on the address as the last change left it, so two quick choices (two bands) both count; found in the browser, because React Router's function form only sees the address of the last render.The sort (#128)
?sort=difficulty&dir=desc.The backend (small, for the vault filter)
filter.difficultyValuesnow also works for vault (apparatusId: "VT", or a vault group): it compares the D-value, 0.1-10.0 in steps of 0.1. Without an apparatus or a vault group it still only filters elements, because the two scales cannot be compared. It used to answerBAD_USER_INPUTfor vault.Apparatus.difficultyValues: the values that exist on the apparatus, lowest first. It is onegroupBythrough Prisma (no raw SQL), read once and kept for ten minutes together with the apparatus and the groups, so it costs nothing per request.schema.graphql,docs/API.mdand the tests are updated. No new dependency, no migration.Page titles and documentation
PageTitlecomponent with the React 19<title>(moved to the head by React, no library), and the default inindex.htmlis "WAG CoP Planner". Before, every page was called "t29-project-2".docs/AI_USAGE.mddescribes the whole pull request.Choices
MenuandTooltipthat the project already depends on, anduseSearchParamsfrom React Router.VITE_API_URL=/project2/graphql npm run buildgives/project2/paths.Testing
tsc -b,eslint,npm run build(also withVITE_API_URL=/project2/graphql), the backendtscand 442 tests pass: the frontend, and the backend search and server tests against a seeded database.Apparatus.difficultyValues.onClickhandler (removed), a menu that stayed open after one choice, and a test that was too weak (all fixed).localhost) against the real backend and the real catalog (562 entries): 26 checks, including the filters, the group order, the tooltip on hover, keyboard focus and tap, the address, reload, back, clear, the sort list, vault D-value filter and sort by the D-score in both directions, search with a filter and "Load more", a wrong address, and the title of every page after a client-side navigation. No console errors and no failed requests.Open points
Apparatus.difficultyValues.Closes #127
Closes #128
🤖 Generated with Claude Code